package com.qijian.maindata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 项目对象 main_project
 *
 * @author qijian
 * @date 2021-10-06
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("main_project")
public class Project extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键")
    private Long projectId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "金蝶fid")
    private Long fid;
    /**
     * 项目所属人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "项目所属人")
    private Long userId;

    /**
     * BOM
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "BOM")
    private Long bomId;

    @Excel(name = "BOM名称", sort = 4)
    @ApiModelProperty(value = "物料名称")
    private String bomName;

    /**
     * 物料
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "物料")
    private Long itemId;

    /**
     * 销售订单
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "销售订单")
    private Long saleId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "销售订单详情id")
    private Long saleDetailId;

    /**
     * 项目类型
     */
    @ApiModelProperty(value = "项目类型")
    private String projectType;

    /**
     * 项目编号
     */
    @Excel(name = "开工令", sort = 1)
    @ApiModelProperty(value = "开工令")
    private String projectNo;

    /**
     * 项目名称
     */
    @Excel(name = "项目名称", sort = 6)
    @ApiModelProperty(value = "项目名称")
    private String projectName;

    /**
     * 机台号
     */
    @Excel(name = "机台号", sort = 2)
    @ApiModelProperty(value = "机台号")
    private String machineNo;

    @ApiModelProperty(value = "开工令")
    private String projectMachineNo;
    /**
     * 项目状态
     */
    @Excel(name = "项目状态", dictType = "project_status", sort = 10)
    @ApiModelProperty(value = "项目状态")
    private Integer status;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    /**
     * 完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "完成时间")
    private Date completeTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "商务交期", width = 30, dateFormat = "yyyy-MM-dd", sort = 5)
    @ApiModelProperty(value = "商务交期")
    private Date expireTime;

    /**
     * 是否生成工单
     */
    @ApiModelProperty(value = "是否生成工单")
    private Boolean isDist;

    /**
     * 审核者
     */
    @ApiModelProperty(value = "审核者")
    private String approvalBy;

    /**
     * 审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "审核时间")
    private Date approvalTime;

    /**
     * 审核状态
     */
    @ApiModelProperty(value = "审核状态")
    private String approvalStatus;

    /**
     * 是否允许点工
     */
    @ApiModelProperty(value = "是否允许点工")
    private Boolean isPoint;
    /**
     * 质量控制数量
     */
    @ApiModelProperty(value = "质量控制数量")
    private BigDecimal qualityControlQty;
    /**
     * 质量控制金额
     */
    @ApiModelProperty(value = "质量控制金额")
    private BigDecimal qualityControlAmount;
    @ApiModelProperty(value = "8D完成率")
    private BigDecimal bdCompletionRate;

    private String gzFlag;

    @ApiModelProperty(value = "套数")
    private Integer beqQty;


    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划出厂日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "计划出厂日期")
    private Date kingdeeReleaseDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "客户交期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "客户交期")
    private Date orderShipmentDate;

    @ApiModelProperty(value = "完工日期")
    private Date newProcessFinishDate;

    @ApiModelProperty(value = "发货时间")
    private Date newReleaseDate;

    /**
     * 物流费用
     */
    private BigDecimal actualDeliveryCost;

    //同步时的产品编码
    @TableField(exist = false)
    private Long syncProductCode;
    //同步时的产品名称
    @TableField(exist = false)
    private String syncProductName;
    //同步时的产品类型
    @ApiModelProperty(value = "产品类型")
    private String syncProductType;

    @ApiModelProperty(value = "1:钛板产线")
    public String titaniumFlag;
}
